package com.huanwei.me_question;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.RelativeLayout;

import com.huanwei.cc.base.MyApplication;
import com.huanwei.cc.R;
import com.huanwei.cc.bean.Life_MSG;
import com.huanwei.cc.db.Z_MSGDao;
import com.huanwei.me_question.adapter.WDWT_Adapter;

import java.util.List;

/**
 * Created by ADM on 2017/12/2.
 * 我的问题
 */

public class Me_Wenti_activity extends FragmentActivity {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_went);
        initViewsAndEvents();
    }


    public void initViewsAndEvents() {
        RelativeLayout img_back = (RelativeLayout) findViewById(R.id.img_back);//设置;
        img_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        ListView lvList = (ListView) findViewById(R.id.lv_list);//设置;
        lvList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

            }
        });
        Z_MSGDao z_msgDao = new Z_MSGDao(MyApplication.getInstance());
        List<Life_MSG> query = z_msgDao.query();
        WDWT_Adapter bank_card_adapter = new WDWT_Adapter();
        lvList.setAdapter(bank_card_adapter);
        bank_card_adapter.addItem(query);

    }
}
